Nonvolatile memory is known in which insulating layers and conductive layers are stacked alternately in a stacked body, and multiple memory cells are stacked in a three-dimensional structure in the height direction of the stacked body. The memory cells are provided between the stacked body and a columnar portion including a semiconductor layer along the height direction of the stacked body. The memory cells are connected electrically in series between, for example, a drain-side select transistor provided in the upper region of the stacked body and, for example, a source-side select transistor provided in the lower region of the stacked body. This is called a NAND string (or a memory string). The conductive layers that are stacked in the height direction of the stacked body are used as a gate (a drain-side select gate) of the drain-side select transistor, control gates (word lines) of the memory cells, and a gate (a source-side select gate) of the source-side select transistor. There are cases where transistors that are included in a memory peripheral circuit are provided under the stacked body. Recently, for the source formation region of the NAND string, for example, a method has been attempted in which a sacrificial film is formed in a portion of the lower region of the stacked body; and the sacrificial film is replaced with a semiconductor layer used to form the source. It is desirable to suppress the collapse of the stacked body when replacing the sacrificial film with the semiconductor layer.